home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15667 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  53 lines

  1. Path: news.compuserve.com!newsmaster
  2. From: Philippe Verdy <100105.3120@compuserve.com>
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: Re: [Q] I'm having a problem linking this simple one...
  5. Date: 7 Apr 1996 22:15:42 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4k9eqe$fl9@arl-news-svc-5.compuserve.com>
  8. NNTP-Posting-Host: ad04-110.compuserve.com
  9.  
  10. jmartin@personalvision (Jonathan Martin) s'Θcrit :
  11. > Ok, I'm teaching myself c++, so bare with me.
  12. > When I compile this:
  13. >     #include <CursesW.h>
  14. >     main () {
  15. >         CursesWindow mine (20,20,5,5);
  16. >     }
  17. > with the command line:
  18. >     g++ -I/usr/include/ncurses -ohello hello.cc
  19. > I get this from the linker:
  20. > /tmp/cca...: undefined reference to 'CursesWindow::~CursesWindow(void)'
  21. > /tmp/cca...: undefined reference to 'CursesWindow::CursesWindow(int,int,int,int)'
  22. > I checked the command line that g++ is feeding to ld, and -lg++ is 
  23. > there. I made a hello.o and checked the symbol table, and the symbols 
  24. > that ld's having trouble with seem to match those in libg++ ok.  I 
  25. > dunno.  Like I said, I'm new at this.
  26. > Any help would be greatly appreciated.
  27. > -Jon
  28. > jmartin@snet.net
  29. May be -lg++ is not enough to find your library.
  30. You may also need to use the -L/usr/g++/lib or other
  31. to specify where to search for libraries.
  32. Beware also of what kind of library you use.
  33. Don't you link with dynamic link libraries and only have a
  34. static library for Curses ? if so, add a binding option
  35. before the -lg++ (e.g. -dy or -dn with Sun linker).
  36. Did you compile the Curses library with the same version
  37. of the compiler ? if not, may be the mangling rules differ
  38. from your library to your compiler.
  39. Do you use the correct set of libraries (for other versions
  40. of g++ for example). Check your environment variables...
  41. Do you use the right version of g++ ? Try "g++ -v"...
  42.  
  43. Hope this will help.
  44.  
  45.